<template lang="html">
  <div class="" id="">
    <h2 v-title="'支付成功'"></h2>
    <div class="succesPayfor">
      <img src="@/assets/images/success@2x.png" alt="">
      <p>支付成功</p>
      <span>支付成功，请等待管家为您确认</span>
    </div>
  </div>
</template>

<script>
import { MessageBox,Toast } from 'mint-ui';
import qs from 'qs';
export default {
  name:'payforSuccess',
  data:() => ({

  }),
  mounted() {
    //do something after mounting vue instance
    let contractId = this.$route.query.contractId;   //合同id
    let token = window.localStorage.getItem('userToken');   //用户token

    let contractParam = {
      contractId:contractId
    }
    // network.post(configUrl.CONTACTONLINE_URL,contractParam,function(res){
    //   console.log(res);
    //   window.location.href = res.data.url;
    // },function(err){
    //   console.log(err);
    // });
    this.$ajax.post(configUrl.CONTACTONLINE_URL,qs.stringify(contractParam)).then(response=>{
      console.log(response);

      let data = response.data;
      if(data.code==500){
        Toast(data.message);
        this.$router.go(-3);
      }else{
        window.location.href = data.data.url;
      }
    }).catch(error=>{
      console.log(error);
    })

  }
}
</script>

<style lang="scss" scoped>
@import "@/main.scss";
.succesPayfor{
  text-align: center;
  padding-top: 4rem;
  line-height: 1.8rem;
  img{
    width: 30%;
  }
  p{
    font-size: 1.2rem;
    margin-top: 1.8rem;
    font-weight: bold;
  }
  span{
    color: $grayColor;
  }
}
</style>
